<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/SpecailYieldTrends/specailYieldTrends" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="specailYieldTrends" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/SpecailYieldTrends/exportExcel')" data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;
        </div>
    </form>
</div>

<div class="bjui-pageContent">
    <g:if test="${specailTrendsByLot.size() > 0}">
        <div style="margin:15px auto 0; width:88%;">
                    <div id="specailTrendsByLot" style="width:80%;height: 600px" ></div>
                    <script  src="${request.getContextPath()}/js/echarts/echarts.js"></script>
                    <script  src="${request.getContextPath()}/js/echarts/echarts-tool.js"></script>
                    <script type="text/javascript">
                        // 基于准备好的dom，初始化echarts实例
                        var contextPath = "${request.getContextPath()}";
                        eChartsTool.init(contextPath);
                        var data=[];
                        // 指定图表的配置项和数据
                        var option = {
                            /*backgroundColor: 'rgba(0,0,0,0)', // 工具箱背景颜色*/
                            // 图表标题
                            title: {
                            },
                            tooltip : {
                                trigger: ''
                            },
                            legend: {
                                data:['内部','外协']
                            },
                            xAxis: {
                                data:['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
                            },
                            yAxis : [
                                /* {
                                 type : 'value'
                                 },*/
                                {
                                    type : 'value',
                                    name:'数量',

                                    axisLabel : {
                                        formatter: '{value}'
                                    },
                                    show:true
                                }
                            ],
                            series : [
                                {
                                    name: '内部',
                                    type: 'line',
                                    data:[${specailTrendsByLot[0].January},${specailTrendsByLot[0].February},${specailTrendsByLot[0].MARCH},${specailTrendsByLot[0].APRIL},${specailTrendsByLot[0].MAY},${specailTrendsByLot[0].JUNE}
                                        ,${specailTrendsByLot[0].JULY},${specailTrendsByLot[0].AUGUST},${specailTrendsByLot[0].SEPTEMBER},${specailTrendsByLot[0].OCTOBER},${specailTrendsByLot[0].NOVEMBER},${specailTrendsByLot[0].DECEMBER}]
                                },{
                                    name: '外协',
                                    type: 'line',
                                    data:[${specailTrendsByLot[1].January},${specailTrendsByLot[1].February},${specailTrendsByLot[1].MARCH},${specailTrendsByLot[1].APRIL},${specailTrendsByLot[1].MAY},${specailTrendsByLot[1].JUNE}
                                        ,${specailTrendsByLot[1].JULY},${specailTrendsByLot[1].AUGUST},${specailTrendsByLot[1].SEPTEMBER},${specailTrendsByLot[1].OCTOBER},${specailTrendsByLot[1].NOVEMBER},${specailTrendsByLot[1].DECEMBER}]
                                }

                            ]
                        };
                        // 使用刚指定的配置项和数据显示图表。
                        eChartsTool.setOption("roma", document.getElementById('specailTrendsByLot'), option);
                    </script>
                    <div class="tableName" align="center" style="font-weight:bold;font-size:18px">制造番号(批次）</div>
                    <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
                        <thead>
                        <tr >
                            <g:each in="${tableHeadList}" status="j" var="headInstance">
                                <g:if test="${headInstance!='RN'}">
                                    <th  width="60"><g:message code="${headInstance}" default="${headInstance}"/></th>
                                </g:if>
                            </g:each>

                        </tr>
                        </thead>
                        <tbody>
                        <g:if test="${specailTrendsByLot.size()>0}">
                            <g:each in="${specailTrendsByLot}" status="i" var="dataInstance">
                                <tr>
                                    <g:each in="${tableHeadList}" status="j" var="headInstance">
                                        <g:if test="${headInstance!='RN'}">
                                            <td>${dataInstance["${headInstance}"]}</td>
                                        </g:if>
                                    </g:each>
                                </tr>
                            </g:each>

                        </g:if>
                        <g:else>
                            <g:render template="../template/emptyPanel" />
                        </g:else>
                        </tbody>
                    </table>
        </div>
    </g:if>
    <g:if test="${specailTrendsByEA.size() > 0}">
        <div style="margin:15px auto 0; width:88%;">
            <div id="specailTrendsByEA" style="width:80%;height: 600px" ></div>
            <script  src="${request.getContextPath()}/js/echarts/echarts.js"></script>
            <script  src="${request.getContextPath()}/js/echarts/echarts-tool.js"></script>
            <script type="text/javascript">
                // 基于准备好的dom，初始化echarts实例
                var contextPath = "${request.getContextPath()}";
                eChartsTool.init(contextPath);
                var data=[];
                // 指定图表的配置项和数据
                var option = {
                    /*backgroundColor: 'rgba(0,0,0,0)', // 工具箱背景颜色*/
                    // 图表标题
                    title: {
                    },
                    tooltip : {
                        trigger: ''
                    },
                    legend: {
                        data:['内部','外协','合计']
                    },
                    xAxis: {
                        data:['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
                    },
                    yAxis : [
                        /* {
                         type : 'value'
                         },*/
                        {
                            type : 'value',
                            name:'数量',

                            axisLabel : {
                                formatter: '{value}'
                            },
                            show:true
                        }
                    ],
                    series : [
                        {
                            name: '内部',
                            type: 'bar',
                            data:[${specailTrendsByEA[0].January},${specailTrendsByEA[0].February},${specailTrendsByEA[0].MARCH},${specailTrendsByEA[0].APRIL},${specailTrendsByEA[0].MAY},${specailTrendsByEA[0].JUNE}
                                ,${specailTrendsByEA[0].JULY},${specailTrendsByEA[0].AUGUST},${specailTrendsByEA[0].SEPTEMBER},${specailTrendsByEA[0].OCTOBER},${specailTrendsByEA[0].NOVEMBER},${specailTrendsByEA[0].DECEMBER}]
                        },{
                            name: '外协',
                            type: 'bar',
                            data:[${specailTrendsByEA[1].January},${specailTrendsByEA[1].February},${specailTrendsByEA[1].MARCH},${specailTrendsByEA[1].APRIL},${specailTrendsByEA[1].MAY},${specailTrendsByEA[1].JUNE}
                                ,${specailTrendsByEA[1].JULY},${specailTrendsByEA[1].AUGUST},${specailTrendsByEA[1].SEPTEMBER},${specailTrendsByEA[1].OCTOBER},${specailTrendsByEA[1].NOVEMBER},${specailTrendsByEA[1].DECEMBER}]
                        },{
                            name: '合计',
                            type: 'line',
                            itemStyle: {
                                normal: {
                                    color: '#9A32CD'
                                }
                            },
                            data:[${specailTrendsByEA[2].January},${specailTrendsByEA[2].February},${specailTrendsByEA[2].MARCH},${specailTrendsByEA[2].APRIL},${specailTrendsByEA[2].MAY},${specailTrendsByEA[2].JUNE}
                                ,${specailTrendsByEA[2].JULY},${specailTrendsByEA[2].AUGUST},${specailTrendsByEA[2].SEPTEMBER},${specailTrendsByEA[2].OCTOBER},${specailTrendsByEA[2].NOVEMBER},${specailTrendsByEA[2].DECEMBER}]
                        }

                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                eChartsTool.setOption("roma", document.getElementById('specailTrendsByEA'), option);
            </script>
                    <div class="tableName" align="center" style="font-weight:bold;font-size:18px">特采数量（EA）</div>
                    <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
                        <thead>
                        <tr >
                            <g:each in="${tableHeadList2}" status="j" var="headInstance">
                                <g:if test="${headInstance!='RN'}">
                                    <th  width="60"><g:message code="${headInstance}" default="${headInstance}"/></th>
                                </g:if>
                            </g:each>

                        </tr>
                        </thead>
                        <tbody>
                        <g:if test="${specailTrendsByEA.size()>0}">
                            <g:each in="${specailTrendsByEA}" status="i" var="dataInstance">
                                <tr>
                                    <g:each in="${tableHeadList2}" status="j" var="headInstance">
                                        <g:if test="${headInstance!='RN'}">
                                            <td>${dataInstance["${headInstance}"]}</td>
                                        </g:if>
                                    </g:each>
                                </tr>
                            </g:each>

                        </g:if>
                        <g:else>
                            <g:render template="../template/emptyPanel" />
                        </g:else>
                        </tbody>
                    </table>
        </div>
    </g:if>
    <g:if test="${specailTrendsByPost.size() > 0}">
        <div style="margin:15px auto 0; width:88%;">
            <div id="specailTrendsByPost" style="width:80%;height: 600px" ></div>
            <script  src="${request.getContextPath()}/js/echarts/echarts.js"></script>
            <script  src="${request.getContextPath()}/js/echarts/echarts-tool.js"></script>
            <script type="text/javascript">
                // 基于准备好的dom，初始化echarts实例
                var contextPath = "${request.getContextPath()}";
                eChartsTool.init(contextPath);
                var data=[];
                <g:each in="${specailTrendsByPost}" status="i" var="tableInstance">
                data.push('${tableInstance.KEY_ID}');
                </g:each>

                // 指定图表的配置项和数据
                var option = {
                    /*backgroundColor: 'rgba(0,0,0,0)', // 工具箱背景颜色*/
                    // 图表标题
                    title: {

                    },

                    tooltip : {
                        trigger: ''
                    },

                    legend: {
                        data:['数量','占比']

                    },
                    xAxis: {
                        data:data
                    },
                    yAxis : [
                        {
                            type : 'value'
                        },
                        {
                            type : 'value',
                            name:'占比',

                            axisLabel : {
                                formatter: '{value}%'
                            },
                            show:true
                        }
                    ],
                    series : [
                        {
                            name: '数量',
                            type: 'bar',
                            data:${specailTrendsByPost.SPECAIL_QTY}
                        },
                        {
                            name: '占比',
                            type: 'line',
                            data:${list},
                            yAxisIndex: 1
                        }]
                };
                // 使用刚指定的配置项和数据显示图表。
                eChartsTool.setOption("roma", document.getElementById('specailTrendsByPost'), option);
            </script>
            <div class="tableName" align="center" style="font-weight:bold;font-size:18px">责任工序</div>
            <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
                <thead>
                <tr id="t1">
                    <g:each in="${tableHeadList3}" status="j" var="headInstance">
                        <g:if test="${headInstance!='RN'}">
                            <th  width="60"><g:message code="${headInstance}" default="${headInstance}"/></th>
                        </g:if>
                    </g:each>
                    <th>累计比(%)</th>
                </tr>
                </thead>
                <tbody>
                <g:if test="${specailTrendsByPost.size()>0}">
                    <g:each in="${specailTrendsByPost }" status="i" var="dataInstance">
                        <tr>
                            <g:each in="${tableHeadList3}" status="j" var="headInstance">
                                <g:if test="${headInstance!='RN'}">
                                    <td>${dataInstance["${headInstance}"]}</td>
                                </g:if>
                            </g:each>
                            <td>${list[i]}</td>
                        </tr>
                    </g:each>
                </g:if>
                </tbody>
            </table>
        </div>

    </g:if>
</div>

